<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>使用字面量语法传递数值</title>
    <script src="vue.js"></script>
  </head>
  <body>
    <!-- 传递了一个字符串 "123" -->
    <div id="example">
      <app-parent></app-parent>
    </div>
    <script>
      // 创建根实例
      var vm = new Vue({
        el: "#example",
        components: {
          appParent: {
            template: `
                  <div>
                      <app-child app-para="123"></app-child>
                  </div>
                  `,
            components: {
              appChild: {
                template: "<h1>{{ appPara }}的数据类型是{{ type }}</h1>",
                props: ["appPara"],
                computed: {
                  type() {
                    return typeof(this.appPara);
                  },
                },
              },
            },
          },
        },
      });
    </script>
  </body>
</html>
